-
Notifications
You must be signed in to change notification settings - Fork 5.1k
/
scheduledQueryRule_API.json
641 lines (641 loc) · 20.9 KB
/
scheduledQueryRule_API.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
{
"swagger": "2.0",
"info": {
"version": "2020-05-01-preview",
"title": "Scheduled Query Rules API",
"description": "Azure Monitor client to create/update/delete Scheduled Query Rules."
},
"host": "management.azure.com",
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"security": [
{
"azure_auth": [
"user_impersonation"
]
}
],
"securityDefinitions": {
"azure_auth": {
"type": "oauth2",
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
"flow": "implicit",
"description": "Azure Active Directory OAuth2 Flow",
"scopes": {
"user_impersonation": "impersonate your user account"
}
}
},
"paths": {
"/subscriptions/{subscriptionId}/providers/Microsoft.Insights/scheduledQueryRules": {
"get": {
"tags": [
"ScheduledQueryRules"
],
"description": "Retrieve a scheduled query rule definitions in a subscription.",
"operationId": "ScheduledQueryRules_ListBySubscription",
"parameters": [
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "Successful request for a list of scheduled query rules",
"schema": {
"$ref": "#/definitions/ScheduledQueryRuleResourceCollection"
}
},
"default": {
"description": "BadRequest",
"schema": {
"$ref": "#/definitions/ErrorContract"
}
}
},
"x-ms-pageable": {
"nextLinkName": null
},
"x-ms-examples": {
"List scheduled query rules": {
"$ref": "./examples/listScheduledQueryRulesBySubscription.json"
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules": {
"get": {
"tags": [
"ScheduledQueryRules"
],
"description": "Retrieve scheduled query rule definitions in a resource group.",
"operationId": "ScheduledQueryRules_ListByResourceGroup",
"parameters": [
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "Successful request for a list of scheduled query rules",
"schema": {
"$ref": "#/definitions/ScheduledQueryRuleResourceCollection"
}
},
"default": {
"description": "BadRequest",
"schema": {
"$ref": "#/definitions/ErrorContract"
}
}
},
"x-ms-pageable": {
"nextLinkName": null
},
"x-ms-examples": {
"List scheduled query rules": {
"$ref": "./examples/listScheduledQueryRulesByResourceGroup.json"
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/scheduledQueryRules/{ruleName}": {
"get": {
"tags": [
"ScheduledQueryRules"
],
"description": "Retrieve an scheduled query rule definition.",
"operationId": "ScheduledQueryRules_Get",
"parameters": [
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "#/parameters/RuleNameParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "Successful request to get a scheduled query rule",
"schema": {
"$ref": "#/definitions/ScheduledQueryRuleResource"
}
},
"default": {
"description": "BadRequest",
"schema": {
"$ref": "#/definitions/ErrorContract"
}
}
},
"x-ms-examples": {
"Get a scheduled query rule for single resource": {
"$ref": "./examples/getScheduledQueryRule.json"
}
}
},
"put": {
"tags": [
"ScheduledQueryRules"
],
"description": "Creates or updates a scheduled query rule.",
"operationId": "ScheduledQueryRules_CreateOrUpdate",
"parameters": [
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "#/parameters/RuleNameParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter"
},
{
"name": "parameters",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/ScheduledQueryRuleResource"
},
"description": "The parameters of the rule to create or update."
}
],
"responses": {
"200": {
"description": "Successful request to update a scheduled query rule",
"schema": {
"$ref": "#/definitions/ScheduledQueryRuleResource"
}
},
"201": {
"description": "Created a scheduled query rule",
"schema": {
"$ref": "#/definitions/ScheduledQueryRuleResource"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/ErrorContract"
}
}
},
"x-ms-examples": {
"Create or update a scheduled query rule for Single Resource": {
"$ref": "./examples/createOrUpdateScheduledQueryRule.json"
},
"Create or update a scheduled query rule on Resource group(s)": {
"$ref": "./examples/createOrUpdateScheduledQueryRuleResourceGroup.json"
},
"Create or update a scheduled query rule on Subscription ": {
"$ref": "./examples/createOrUpdateScheduledQueryRuleSubscription.json"
}
}
},
"patch": {
"tags": [
"ScheduledQueryRules"
],
"description": "Update a scheduled query rule.",
"operationId": "ScheduledQueryRules_Update",
"parameters": [
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "#/parameters/RuleNameParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter"
},
{
"name": "parameters",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/ScheduledQueryRuleResourcePatch"
},
"description": "The parameters of the rule to update."
}
],
"responses": {
"200": {
"description": "Successful request to update a scheduled query rule",
"schema": {
"$ref": "#/definitions/ScheduledQueryRuleResource"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/ErrorContract"
}
}
},
"x-ms-examples": {
"Create or update a scheduled query rule": {
"$ref": "./examples/patchScheduledQueryRule.json"
}
}
},
"delete": {
"tags": [
"ScheduledQueryRules"
],
"description": "Deletes a scheduled query rule.",
"operationId": "ScheduledQueryRules_Delete",
"parameters": [
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "#/parameters/ResourceGroupNameParameter"
},
{
"$ref": "#/parameters/RuleNameParameter"
},
{
"$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter"
}
],
"responses": {
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/ErrorContract"
}
},
"200": {
"description": "Successful request to delete a scheduled query rule"
},
"204": {
"description": "No content: the request was successful, but the response is empty"
}
},
"x-ms-examples": {
"Delete a scheduled query rule": {
"$ref": "./examples/deleteScheduledQueryRule.json"
}
}
}
}
},
"definitions": {
"Action": {
"type": "object",
"description": "Actions to invoke when the alert fires.",
"properties": {
"actionGroupId": {
"type": "string",
"description": "Action Group resource Id to invoke when the alert fires."
},
"webHookProperties": {
"type": "object",
"additionalProperties": {
"type": "string",
"description": "The dictionary of custom properties to include with the post operation. These data are appended to the webhook payload."
},
"description": "The properties of a webhook object."
}
}
},
"ScheduledQueryRuleProperties": {
"properties": {
"createdWithApiVersion": {
"type": "string",
"readOnly": true,
"description": "The api-version used when creating this alert rule"
},
"isLegacyLogAnalyticsRule": {
"type": "boolean",
"readOnly": true,
"description": "True if alert rule is legacy Log Analytic rule"
},
"description": {
"type": "string",
"description": "The description of the scheduled query rule."
},
"displayName": {
"type": "string",
"description": "The display name of the alert rule"
},
"severity": {
"type": "number",
"description": "Severity of the alert. Should be an integer between [0-4]. Value of 0 is severest",
"enum": [
"0",
"1",
"2",
"3",
"4"
],
"x-ms-enum": {
"name": "AlertSeverity",
"modelAsString": true
}
},
"enabled": {
"type": "boolean",
"description": "The flag which indicates whether this scheduled query rule is enabled. Value should be true or false"
},
"scopes": {
"type": "array",
"items": {
"type": "string"
},
"description": "The list of resource id's that this scheduled query rule is scoped to."
},
"evaluationFrequency": {
"type": "string",
"format": "duration",
"description": "How often the scheduled query rule is evaluated represented in ISO 8601 duration format."
},
"windowSize": {
"type": "string",
"format": "duration",
"description": "The period of time (in ISO 8601 duration format) on which the Alert query will be executed (bin size)."
},
"OverrideQueryTimeRange": {
"type": "string",
"format": "duration",
"description": "If specified then overrides the query time range (default is WindowSize*NumberOfEvaluationPeriods)"
},
"targetResourceTypes": {
"type": "array",
"items": {
"type": "string"
},
"description": "List of resource type of the target resource(s) on which the alert is created/updated. For example if the scope is a resource group and targetResourceTypes is Microsoft.Compute/virtualMachines, then a different alert will be fired for each virtual machine in the resource group which meet the alert criteria"
},
"criteria": {
"$ref": "#/definitions/ScheduledQueryRuleCriteria",
"description": "The rule criteria that defines the conditions of the scheduled query rule."
},
"muteActionsDuration": {
"type": "string",
"format": "duration",
"description": "Mute actions for the chosen period of time (in ISO 8601 duration format) after the alert is fired."
},
"actions": {
"type": "array",
"items": {
"$ref": "#/definitions/Action"
}
}
},
"description": "scheduled query rule Definition"
},
"ScheduledQueryRuleResource": {
"type": "object",
"allOf": [
{
"$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/TrackedResource"
}
],
"required": [
"properties"
],
"properties": {
"kind": {
"type": "string",
"readOnly": true,
"description": "Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value."
},
"etag": {
"type": "string",
"readOnly": true,
"description": "The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. "
},
"properties": {
"x-ms-client-flatten": true,
"$ref": "#/definitions/ScheduledQueryRuleProperties",
"description": "The rule properties of the resource.",
"required": [
"enabled",
"severity",
"evaluationFrequency",
"windowSize",
"criteria",
"scopes"
]
}
},
"description": "The scheduled query rule resource."
},
"ScheduledQueryRuleResourcePatch": {
"type": "object",
"properties": {
"tags": {
"additionalProperties": {
"type": "string"
},
"description": "Resource tags"
},
"properties": {
"x-ms-client-flatten": true,
"$ref": "#/definitions/ScheduledQueryRuleProperties",
"description": "The scheduled query rule properties of the resource."
}
},
"description": "The scheduled query rule resource for patch operations."
},
"ScheduledQueryRuleResourceCollection": {
"properties": {
"value": {
"type": "array",
"items": {
"$ref": "#/definitions/ScheduledQueryRuleResource"
},
"description": "The values for the scheduled query rule resources."
}
},
"description": "Represents a collection of scheduled query rule resources."
},
"ScheduledQueryRuleCriteria": {
"type": "object",
"description": "The rule criteria that defines the conditions of the scheduled query rule.",
"properties": {
"allOf": {
"type": "array",
"description": "A list of conditions to evaluate against the specified scopes",
"items": {
"$ref": "#/definitions/Condition"
}
}
}
},
"Condition": {
"type": "object",
"description": "A condition of the scheduled query rule.",
"properties": {
"query": {
"type": "string",
"description": "Log query alert"
},
"timeAggregation": {
"type": "string",
"description": "Aggregation type",
"enum": [
"Count",
"Average",
"Minimum",
"Maximum",
"Total"
],
"x-ms-enum": {
"name": "timeAggregation",
"modelAsString": true
}
},
"metricMeasureColumn": {
"type": "string",
"description": "The column containing the metric measure number."
},
"resourceIdColumn": {
"type": "string",
"description": "The column containing the resource id. The content of the column must be a uri formatted as resource id"
},
"dimensions": {
"type": "array",
"items": {
"$ref": "#/definitions/Dimension"
},
"description": "List of Dimensions conditions"
},
"operator": {
"type": "string",
"enum": [
"Equals",
"GreaterThan",
"GreaterThanOrEqual",
"LessThan",
"LessThanOrEqual"
],
"x-ms-enum": {
"name": "conditionOperator",
"modelAsString": true
},
"description": "The criteria operator."
},
"threshold": {
"type": "number",
"format": "double",
"description": "the criteria threshold value that activates the alert."
},
"failingPeriods": {
"type": "object",
"description": "The minimum number of violations required within the selected lookback time window required to raise an alert.",
"properties": {
"numberOfEvaluationPeriods": {
"type": "integer",
"format": "int64",
"default": 1,
"description": "The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points. Default value is 1"
},
"minFailingPeriodsToAlert": {
"type": "integer",
"format": "int64",
"default": 1,
"description": "The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods. Default value is 1"
}
}
}
},
"required": [
"operator",
"threshold",
"timeAggregation"
]
},
"Dimension": {
"type": "object",
"description": "Dimension splitting and filtering definition",
"properties": {
"name": {
"type": "string",
"description": "Name of the dimension"
},
"operator": {
"type": "string",
"description": "Operator for dimension values",
"enum": [
"Include",
"Exclude"
],
"x-ms-enum": {
"name": "dimensionOperator",
"modelAsString": true
}
},
"values": {
"type": "array",
"items": {
"type": "string"
},
"description": "List of dimension values"
}
},
"required": [
"name",
"operator",
"values"
]
},
"ErrorContract": {
"description": "Describes the format of Error response.",
"type": "object",
"properties": {
"error": {
"description": "The error details.",
"$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ErrorResponse"
}
}
}
},
"parameters": {
"ResourceGroupNameParameter": {
"name": "resourceGroupName",
"in": "path",
"required": true,
"type": "string",
"description": "The name of the resource group.",
"x-ms-parameter-location": "method"
},
"RuleNameParameter": {
"name": "ruleName",
"in": "path",
"required": true,
"type": "string",
"description": "The name of the rule.",
"x-ms-parameter-location": "method"
}
}
}